<template>
    <div class="container">
         <!-- :action="baseUrl + props.url" -->
        <el-upload
            class="upload-demo"
            drag
            multiple
            :limit="1"
            :action="baseURL + props.url"
            :auto-upload="true"
            :on-change="updateUp"
        >
            <el-icon class="el-icon--upload"><upload-filled /></el-icon>
            <div class="el-upload__text">
                将文件拖到此处，或
                <em>点击上传</em>
            </div>
        </el-upload>
    </div>
</template>

<script setup lang="ts">
import { reactive } from 'vue'
import { postData } from '../api/index'
import useAPI from '../hooks/useAPI'

const { baseURL } = useAPI()
const props = defineProps({
    url:{
        type:String,
        required:true
    },
    getDate: {
		type: Function,
		required: false
	},
    uploadUpdate: {
        type: Function,
        required: false
    }
})

const updateUp = (rawFile: any) => {
    props.uploadUpdate()
};

</script>

<style scoped>
.content-title {
    font-weight: 400;
    line-height: 10px;
    margin: 10px 0;
    font-size: 22px;
    color: #1f2f3d;
}
</style>